import java.io.IOException;

public class Main{

	/**
	 * @param args
	 * @throws IOException
	 * @throws NumberFormatException
	 */
	public static void main(String[] args) throws NumberFormatException,
			IOException {
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));

		int number = -1;
		while (true) {
			number = Integer.parseInt(r.readLine());
			if (number == 0) {
				break;
			}
			System.out.println(number * (number + 1) * (2 * number + 1) / 6);
		}

	}

}
